
#include "lib.h"

#include <stdlib.h>

#include "VPConn.h"

#include "SevenCardStudSQL.h"
#include "vpsql.h"

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @fn     GameDBInterface::createDBInterface(VPConnection *pConn, ProgressiveTrackSQL *pTracker, Info *pInfo)
///
/// Static method that should generally be called to create instances of the database interfaces for
/// the various games.
///
/// @param  pConn    -   (in) Connection object used to talk to the client via the network
/// @param  pTracker -   (in) pointer to the single instance of the tracker object that all games share.
/// @param  pInfo    -   (in) structure holding miscellaneous info about casino and current user.    
///
/// @return returns a pointer to the newly created database interface instance...or NULL on failure.
///
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
GameDBInterface* GameDBInterface::createDBInterface(VPConnection *pConn, ProgressiveTrackSQL *pTracker, Info *pInfo)
{
    GameDBInterface *pInterface = NULL;
    
    switch(pConn->getGameID())
    {
        case VP_SEVEN_CARD:
        {
            pInterface = new SevenCardStudSQL(pConn, pTracker, pInfo);
            break;
        }
        case VP_FIVE_CARD:
        {
            pInterface = new VPokerSQL(pConn, pTracker, pInfo);
            break;
        }
    }

    return pInterface;
}
